Alias (Mac OS)

In Mac OS System 7 and later, an alias is a small file that represents another object in a local, remote, or removable[1] file system and provides a dynamic link to it; the target object may be moved, and the alias will still link to it (unless the original file is recreated; such an alias is ambiguous and how it is resolved depends on the version of Mac OS X). In Windows, the same function is performed with a "shortcut" (a file with a .lnk extension); in most circumstances, moving the target file breaks the link.

It is similar to the Unix symbolic link, but with the added benefit of working even if the target file moves to another location on the same disk (in this case it acts like hard link, but the source and target of the link may be on different filesystems). As a descendant of BSD, Mac OS X supports Unix symbolic (and hard) links as well.

Contents

Function

An alias acts as a stand-in for any object in the file system, such as a document, an application, a folder, a hard disk, a network share or removable medium or a printer. When double-clicked, the computer will act the same way as if the original file had been double-clicked. Likewise, choosing an alias file from within a 'File Open' dialog box would open the original file. The purpose of an alias is to assist the user in managing large numbers of files by providing alternative ways to access them without having to copy the files themselves. While a typical alias under the classic Mac OS was small, between 1 and 5 KB, under Mac OS X it can be fairly large, more than 500 KB for the alias to a folder.

Preventing Alias Failure

An alias is a dynamic reference to an object. The original may be moved to another place within the same filesystem, without breaking the link. The operating system stores several pieces of information about the original in the resource fork of the alias file. Examples of the information used to locate the original are:

Since any of these properties can change without the computer's knowledge, as a result of user activity, various search algorithms are used to find the most plausible target. This fault-tolerance sets the alias apart from similar functions in some other operating systems, such as the Unix symbolic link or the Microsoft Windows shortcut, at the expense of increased complexity and unpredictability. For example, an application can be moved from one directory to another within the same filesystem, but an existing alias would still launch the same application when double-clicked.

The question can arise of how an alias should work if a file is moved, and then a file is created with the same name as the original moved file, since the alias can be used to locate both the original name and the new location of the original file. With symbolic links the reference is unambiguous and refers to the new file. Before Mac OS X.2, however, such an ambiguous alias would consistently find the original moved file, rather than the recreated file. From Mac OS X.2, the new file is found, matching the behaviour of symbolic links[1]. Mac OS X applications can programmatically use the old behavior if required.

Aliases are similar in operation to shadows in the graphical Workplace Shell of the OS/2 operating system.

Distinguishing marks

In System 7 through Mac OS 9, aliases distinguished themselves visually to the user by the fact that their file names were in italics. To accommodate languages that don't have italics (such as Japanese), in Mac OS 8.5 another distinguishing mark was added, badging with an "alias arrow" - a black arrow with a small white border - similar to that used for shortcuts in Microsoft Windows.

In Mac OS X, the filenames of aliases are not italicized, but the arrow badge remains.

Managing aliases

In System 7, the only way to create an alias was to select the original and choose "Make Alias" from the "File" menu. An alias, with the same name and " alias" appended would then be created in the same folder. In later versions, it became possible to create aliases by drag-and-drop, while holding down the command and option modifier keys.

Mac OS 8.5 added a feature for re-connecting aliases that had been broken for one reason or another (when the simple search algorithms failed to find a reliable replacement).

In Mac OS 9 and X options were added for command-option dragging an object in the Finder to create an alias at that location. This is where the alias cursor was added to the system.

References

External links